from utils import tensorbackend

def compose_matrix(*vectors,backend:tensorbackend.BackendBase,device="cpu"):
    width = len(vectors[0])
    for v in vectors:
        if len(v) != width:
            raise ValueError("Input vectors aren't of the same length")

    res = backend.zeros(shape=(len(vectors), len(vectors[0])), device=device)

    for v in range(0, len(vectors)):
        res[v] = backend.from_python(vectors[v])

    return res